<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>站长注册</title>
    <link rel="stylesheet" href="../../libs/node_modules/bootstrap/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../style/common.css">
    <link rel="stylesheet" href="../../style/home/article.css">
    <link rel="stylesheet" href="../../style/login/register.css">
    <script src="../../libs/jquery-3.2.1.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
    <script src="../../libs/node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
    <script src="../../libs/layer-v3.1.1/layer/layer.js"></script>
    <script src="../../libs/node_modules/echarts/dist/echarts.js"></script>
	<script src="../../libs/vue.js"></script>
	<script src="../../jsc/axios.min.js"></script>
	<script src="../../jsc/common.js"></script>
	<!--<script src="js/system.js"></script>-->
</head>
<body>
<div id="app">
	<header></header>
	<nav></nav>

	<main>
		<div class="content">
			<div class="register-box">
				<form action="" class="register-form" name="content">
					<div class="register-process" style="margin-bottom: 4rem;position: relative">
						<span>1</span>站长注册
						<hr style="border:none;border-bottom:1px dashed #BFBFBF;height:1px;width: 8.94rem">
						<span class="active">2</span>完善信息
						<hr style="border:none;border-bottom:1px dashed #FE7600;height:1px;width: 8.94rem">
						<span>√</span>注册成功

						<div class="static-contact">
							<p>站长注册</p>
							<p>注册新基层站点请联系家园服网管理员</p>
							<p><img src="../../static/icons/邮箱个.png" alt="">jyufuwu@gfli.com</p>
							<p><img src="../../static/icons/手机g.png" alt="">13726346354</p>
							<p><img src="../../static/icons/微信g.png" alt="">13726346354</p>
						</div>
					</div>
					<div class="register-input-box">
						<div class="register-input-item">
							<div class="register-input-name" style="padding-left: 0;justify-content: center">
								紧急联系电话
							</div>
							<input type="text" placeholder="请输入电话号码" name="phone">
						</div>
					</div>
					<div class="register-input-box">
						<div class="register-input-item">
							<div class="register-input-name" style="padding-left: 0;justify-content: center">
								QQ号码
							</div>
							<input type="text" placeholder="请输入您的QQ号" name="qq">
						</div>
					</div>
					<div class="register-input-box">
						<div class="register-input-item">
							<div class="register-input-name" style="padding-left: 0;justify-content: center">
								微信号
							</div>
							<input type="text" placeholder="请输入您的微信号" name="wechat">
						</div>
					</div>
					<div class="register-input-box">
						<div class="register-input-item">
							<div class="register-input-name" style="padding-left: 0;justify-content: center">
								电子邮箱
							</div>
							<input type="text" placeholder="请输入您的电子邮箱" name="email">
						</div>
					</div>
					<div class="register-input-box">
						<div class="register-input-item">
							<div class="register-input-name" style="padding-left: 0;justify-content: center">
								<!--<img src="../../static/icons/手机1.png" alt="">-->
								钉钉号
							</div>
							<input type="text" placeholder="请输入钉钉号" name="dingding">
						</div>
					</div>
					<div class="register-input-box" style="padding-top: 1rem">
						<div class="register-btn" @click="register">提交</div>
					</div>
					<div class="register-input-login">
						已有账户，<a href="login.html">去登录</a>
					</div>
				</form>
			</div>
		</div>
	</main>
	<footer class="footer">

	</footer>
</div>

<script>
    (function () {
        $("header").load("../../views/common/header_common.html");
        $("nav").load("../../views/common/nav_inner.html");
        $("footer").load("../../views/common/footer.html");
    })();
    // function register() {
    //     window.location.href = 'register-success2.html';
    // }

    new Vue({
		el:'#app',
		data:{

		},
		mounted(){

		},
		methods:{
			register:function(){
				let d = new FormData(document.forms.namedItem("content"));
				console.log(JSON.parse(localStorage.getItem('reginfo')));
				let s = JSON.parse(localStorage.getItem('reginfo'));
				let data = new FormData;
				data.append('username',s.username);
				data.append('mobile',s.mobile);
				data.append('password',s.password);
				data.append('sitename',s.sitename);
				data.append('site_area_id',s.site_area_id);
				data.append('site_level',s.site_level);
				data.append('qq',d.get('qq'));
				data.append('wechat',d.get('wechat'));
				data.append('email',d.get('email'));
				data.append('dingding',d.get('dingding'));
				data.append('phone',d.get('phone'));
				// var i = data.entries();
				// for(let e = 0;e<12;e++){
				// 	console.log(i.next().value)
				// }
				axios.post(sysurl+'user/site_register',data).then(res=>{
					console.log(res);
					if (res.data.code==1){
						layer.msg('注册成功');
						setCookie('token',res.data.data.userinfo.token);
						setCookie('user_id',res.data.data.userinfo.user_id);
						localStorage.clear();
						location.href='register-success.html?type=station'
					} else{
						layer.msg(res.data.msg)
					}
				})
			}
		}
	})


</script>
</body>
</html>
